package py.edu.ucsa.sisale.config;

import java.util.HashMap;
import java.util.Map;

public class ConfigurationXMLImpl implements Configuration
{
	
	private Map<String, String> parameters = new HashMap<String, String>();

    private Map<String, String> factories = new HashMap<String, String>();
    private Map<String, String> media = new HashMap<String, String>();
    private String urlProvider;
    
    
    private String appId = null;
    private String restServiceHost = null;
    private String user = null;
    private String pass = null;
    
    
    public String getFactoryClass(String factoryName)
    {
        return this.factories.get(factoryName);
    }

    public void addFactory(String factoryName, String factoryClass)
    {
        this.factories.put(factoryName, factoryClass);
    }

    public String getMediaClass(String name)
    {
        return this.media.get(name);
    }

    public void addMedia(String name, String mediaClass)
    {
        this.media.put(name, mediaClass);
    }

    public String getRestServiceHost()
    {
        return restServiceHost;
    }

    public void setRestServiceHost(String restServiceHost)
    {
        this.restServiceHost = restServiceHost;
    }

    public String getAppId()
    {
        return appId;
    }

    public void setAppId(String appId)
    {
        this.appId = appId;
    }

    public String toString()
    {
        StringBuilder builder = new StringBuilder();
        builder.append("ConfigurationXMLImpl").append(", factories=").append(factories).append("]").append(", media=").append(media).append("]");
        return builder.toString();
    }

    public String getUrlProvider()
    {
        return urlProvider;
    }

    public void setUrlProvider(String urlProvider)
    {
        this.urlProvider = urlProvider;
    }

    public String getUser()
    {
        return user;
    }

    public String getPass()
    {
        return pass;
    }

   
	  public String getParameterValue(String parameterName) {
	    return this.parameters.get(parameterName);
	  } 
	  
	  public void addParameter(String parameterName, String parameterValue){
	    this.parameters.put(parameterName, parameterValue);
	  }

	public void setUser(String user) {
		this.user = user;
	}

	public void setPass(String pass) {
		this.pass = pass;
	}

}